<?php

namespace mbilling\BillingBundle\Model;

use Doctrine\ORM\EntityManager;
use mbilling\BillingBundle\Entity\ordersOS;


Class OrdersOSModel
{
    protected $em;

    public function __construct(EntityManager $em)
    {
        $this->em = $em;
    }

    public function findAll()
    {
        $os = $this->em->getRepository('BillingBundle:ordersOS')->findAll();
        return $os;
    }
    
    public function findByPK($os_id)
    {
        $os = $this->em->find('BillingBundle:ordersOS', $os_id);
        return $os;
    }

    public function create($oEntity)
    {
        $this->em->persist($oEntity);
        $this->em->flush();
    }

    public function removeByPK($os_id)
    {
        $os = $this->em->find('BillingBundle:ordersOS', $os_id);
        $this->em->remove($os);
        $this->em->flush();
    } 
}
?>
